/*
 * Copyright 2012 Marsrutai.lt
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package lt.marsrutai.mobile.android.model;

import java.util.ArrayList;
import java.util.List;

import lt.marsrutai.mobile.android.util.ParcelUtil;
import android.os.Parcel;
import android.os.Parcelable;

public class MobileScope implements Parcelable {

    public static final Parcelable.Creator<MobileScope> CREATOR = new Parcelable.Creator<MobileScope>() {

        @Override
        public MobileScope createFromParcel(Parcel source) {
            return new MobileScope(source);
        }

        @Override
        public MobileScope[] newArray(int size) {
            return new MobileScope[size];
        }
    };

    private String folder;
    private String name;
    private boolean visible;
    private String storedVersion;

    private List<Transport> transports = new ArrayList<Transport>();

    public MobileScope() {
    }

    public MobileScope(Parcel in) {
        folder = in.readString();
        name = in.readString();
        visible = ParcelUtil.readBoolean(in);
        storedVersion = in.readString();
        in.readList(transports, Transport.class.getClassLoader());
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(folder);
        dest.writeString(name);
        ParcelUtil.writeBoolean(dest, visible);
        dest.writeString(storedVersion);
        dest.writeList(transports);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public String getFolder() {
        return folder;
    }

    public void setFolder(String folder) {
        this.folder = folder;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public List<Transport> getTransports() {
        return transports;
    }

    public void setTransports(List<Transport> transports) {
        this.transports = transports;
    }

    public String getStoredVersion() {
        return storedVersion;
    }

    public void setStoredVersion(String storedVersion) {
        this.storedVersion = storedVersion;
    }

}
